Skip to content

refactor: Rename the HTTPX extra and clients to httpx2 - #1048

Merged
vdusek merged 3 commits into
masterfrom
refactor/rename-httpx-extra-to-httpx2
Sep 3, 2026
Merged

refactor: Rename the HTTPX extra and clients to httpx2#1048
vdusek merged 3 commits into
masterfrom
refactor/rename-httpx-extra-to-httpx2

Conversation

@vdusek

@vdusek vdusek commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Renames the optional extra httpx to httpx2, and HttpxHttpClient / HttpxHttpClientAsync to Httpx2HttpClient / Httpx2HttpClientAsync, along with the private module, the docs examples, and the test ids. Once httpx releases 1.0 with a new API, an extra named httpx that installs httpx2 would confuse users (see #1046 (comment)).

Neither name has shipped in a stable release, so nothing is breaking. Kept as is: the import httpx2 as httpx alias inside the module, "HTTPX" as the library name in prose, and the historical v2 upgrade note.

Follows up on #1046.

✍️ Drafted by Claude Code

@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Sep 2, 2026
@vdusek vdusek self-assigned this Sep 2, 2026
@vdusek
vdusek force-pushed the refactor/rename-httpx-extra-to-httpx2 branch from 659bb04 to fcb9f76 Compare September 2, 2026 13:57
@github-actions github-actions Bot added this to the 148th sprint - Tooling team milestone Sep 2, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Sep 2, 2026
@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.27%. Comparing base (56bca2a) to head (3aeb833).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1048   +/-   ##
=======================================
  Coverage   95.27%   95.27%           
=======================================
  Files          59       59           
  Lines        5503     5503           
=======================================
  Hits         5243     5243           
  Misses        260      260           
Flag Coverage Δ
integration 92.22% <100.00%> (-0.02%) ⬇️
unit 87.37% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek
vdusek requested a review from Pijukatel September 2, 2026 14:26
@vdusek
vdusek marked this pull request as ready for review September 2, 2026 14:27
@vdusek
vdusek requested a review from szaganek as a code owner September 2, 2026 14:27
@vdusek
vdusek merged commit ab25d07 into master Sep 3, 2026
30 checks passed
@vdusek
vdusek deleted the refactor/rename-httpx-extra-to-httpx2 branch September 3, 2026 06:36
vdusek added a commit to apify/apify-sdk-python that referenced this pull request Sep 3, 2026
Updates the development lockfile to the current releases of our own
dependencies, and fixes the docs shortcut generator that the new client
broke.

- `apify-client` 3.1.3 -> 3.2.0
- `crawlee` 1.9.3 -> 1.10.0, which pulls `impit` 0.13.2 -> 0.14.0
- `website/generate_module_shortcuts.py` now skips attributes that raise
`ImportError` because an optional extra is missing. `apify-client`
renamed its HTTPX extra to `httpx2` and guards the import
(apify/apify-client-python#1048), so `inspect.getmembers` walking
`apify_client.http_clients` raised `ImportError` and broke the docs
build.

`pyproject.toml` constraints are untouched - both new versions already
satisfy them, so this only moves the lockfile used for development and
CI.

*✍️ Drafted by Claude Code*
vdusek added a commit that referenced this pull request Sep 8, 2026
`_httpx2.py` pulled the library in as `import httpx2 as httpx`, so the
module and its tests read
`httpx.*` throughout while the installed package is `httpx2`. Dropping
the alias lets the code name
the library it actually uses.

The rename follows through: the private transport attributes become
`_httpx2_client` and
`_httpx2_async_client`, matching the sibling adapter's `_impit_client` /
`_impit_async_client`, and
21 test functions plus the `UNSET_HTTPX2_TIMEOUT` constant lose the old
spelling. All of it is
private, so no public name moves. A search for the original `httpx`
under `src/` and `tests/` now
turns up only the two sentences that describe the library's lineage on
purpose.

It also cleans up link labels left over from #1048. Eight places wrote
`[HTTPX](https://github.com/pydantic/httpx2)`, giving the current client
the old library's name, and
the surrounding prose had the same split: docstrings said HTTPX while
the link beside them said
HTTPX2. The library calls itself HTTPX2, so 66 prose references now use
that name. The v2 upgrade
guide is the reverse case: it describes moving off the original `httpx`,
so its link goes back to
python-httpx.org, matching what the 2.5 docs already say. These changes
land in `docs/` only, so
they reach the docs site at `/next` until the next version snapshot.

No behavior changes. The 241 unit tests covering the HTTP clients,
headers, timeouts, and the
pluggable client still pass, 21 of them under new names.

*✍️ Drafted by Claude Code*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants